/*
 * Copyright (C) 2011 CrystalRange
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.crystalrange;

import org.crystalrange.service.UserService;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Textbox;

// TODO: Auto-generated Javadoc
/**
 * The Class LoginController.
 */
public class LoginController extends GenericForwardComposer {

    /** The textbox username. */
    protected Textbox textboxUsername;
    
    /** The textbox password. */
    protected Textbox textboxPassword;
    
    /** The textbox locale. */
    protected Textbox textboxLocale;
    
    /** The user service. */
    protected UserService userService;

    /**
     * Gets the user service.
     *
     * @return the user service
     */
    public UserService getUserService() {
        return this.userService;
    }

    /**
     * Sets the user service.
     *
     * @param userService the new user service
     */
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    /**
     * On click$user login toolbarbutton.
     *
     * @param event the event
     * @throws Exception the exception
     */
    public void onClick$userLoginToolbarbutton(Event event) throws Exception {
        Clients.submitForm("f");
    }

    /**
     * On OK$div.
     *
     * @param event the event
     * @throws Exception the exception
     */
    public void onOK$div(Event event) throws Exception {
        Clients.submitForm("f");
    }
}
